<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Get log detail by level, log_path, key_word, start, limit, order</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="seaslog.analyzercount.html">« SeasLog::analyzerCount</a></li>
      <li style="float: right;"><a href="seaslog.closeloggerstream.html">SeasLog::closeLoggerStream »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.seaslog.html">SeasLog</a></li>
    <li>Get log detail by level, log_path, key_word, start, limit, order</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="seaslog.analyzerdetail" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">SeasLog::analyzerDetail</h1>
  <p class="verinfo">(PECL seaslog &gt;=1.1.6)</p><p class="refpurpose"><span class="refname">SeasLog::analyzerDetail</span> &mdash; <span class="dc-title">Get log detail by level, log_path, key_word, start, limit, order</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-seaslog.analyzerdetail-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><strong>SeasLog::analyzerDetail</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">string</span> <code class="parameter">$level</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">string</span> <code class="parameter">$log_path</code><span class="initializer"> = ?</span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">string</span> <code class="parameter">$key_word</code><span class="initializer"> = ?</span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">int</span> <code class="parameter">$start</code><span class="initializer"> = ?</span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">int</span> <code class="parameter">$limit</code><span class="initializer"> = ?</span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">int</span> <code class="parameter">$order</code><span class="initializer"> = ?</span></span><br>): <span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span></div>

  <p class="para rdfs-comment">
    `SeasLog` get results of 
    `grep -ai &#039;{level}&#039; | grep -ai &#039;{key_word}&#039; |  sed -n &#039;{start},{limit}&#039;p` 
    use system pipe and return array to PHP.
  </p>

 </div>


 <div class="refsect1 parameters" id="refsect1-seaslog.analyzerdetail-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt>
<code class="parameter">level</code></dt>

    <dd>

     <p class="para">
      String. The log information level.
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">log_path</code></dt>

    <dd>

     <p class="para">
      String. The log information path.
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">key_word</code></dt>

    <dd>

     <p class="para">
      String. The search key word for log information.
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">start</code></dt>

    <dd>

     <p class="para">
      Int. Default is `1`.
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">limit</code></dt>

    <dd>

     <p class="para">
      Int. Default is `20`.
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">order</code></dt>

    <dd>

     <p class="para">
      Int. Default is <a href="seaslog.constants.html#constant.seaslog-detail-order-asc" class="link">SEASLOG_DETAIL_ORDER_ASC</a>.
      See also:
        <ul class="simplelist">
         <li class="member"><a href="seaslog.constants.html#constant.seaslog-detail-order-asc" class="link">SEASLOG_DETAIL_ORDER_ASC</a></li>
         <li class="member"><a href="seaslog.constants.html#constant.seaslog-detail-order-desc" class="link">SEASLOG_DETAIL_ORDER_DESC</a></li>
        </ul>
     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-seaslog.analyzerdetail-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Return results as array.
   <blockquote class="note"><p><strong class="note">注意</strong>: 
    <p class="para">
     When `start`,`limit` is not NULL and in Windows, 
     SeasLog will threw exception with message &#039;Param start and limit don&#039;t support Windows&#039;.
    </p>
   </p></blockquote>
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-seaslog.analyzerdetail-examples">
  <h3 class="title">范例</h3>
  <div class="example" id="example-3517">
   <p><strong>示例 #1 <span class="function"><strong>SeasLog::analyzerDetail()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />$result1&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">SeasLog</span><span style="color: #007700">::</span><span style="color: #0000BB">analyzerDetail</span><span style="color: #007700">(</span><span style="color: #0000BB">SEASLOG_ERROR</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//with&nbsp;`logger`&nbsp;and&nbsp;`key_word`<br /></span><span style="color: #0000BB">$result2&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">SeasLog</span><span style="color: #007700">::</span><span style="color: #0000BB">analyzerDetail</span><span style="color: #007700">(</span><span style="color: #0000BB">SEASLOG_ERROR</span><span style="color: #007700">,</span><span style="color: #DD0000">'test/logger/'</span><span style="color: #007700">,</span><span style="color: #DD0000">'neeke'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//with&nbsp;`start`&nbsp;and&nbsp;`limit`<br /></span><span style="color: #0000BB">$result3&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">SeasLog</span><span style="color: #007700">::</span><span style="color: #0000BB">analyzerDetail</span><span style="color: #007700">(</span><span style="color: #0000BB">SEASLOG_ERROR</span><span style="color: #007700">,</span><span style="color: #DD0000">'test/logger/'</span><span style="color: #007700">,</span><span style="color: #DD0000">'neeke'</span><span style="color: #007700">,</span><span style="color: #0000BB">1</span><span style="color: #007700">,</span><span style="color: #0000BB">2</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$result1</span><span style="color: #007700">,</span><span style="color: #0000BB">$result2</span><span style="color: #007700">,</span><span style="color: #0000BB">$result3</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
   </div>

   <div class="example-contents"><p>以上例程的输出类似于：</p></div>
   <div class="example-contents screen">
<div class="cdata"><pre>
array(20) {
  [0]=&gt;
  string(93) &quot;2018-07-09 12:52:53 | ERROR | 12247 | 5b42ea2580e51 | 1531111973.528 | log message from neeke&quot;
  [1]=&gt;
  string(93) &quot;2018-07-09 12:52:54 | ERROR | 12256 | 5b42ea26d6657 | 1531111974.878 | log message from neeke&quot;
  [2]=&gt;
  string(93) &quot;2018-07-09 12:52:55 | ERROR | 12265 | 5b42ea277b8d4 | 1531111975.506 | log message from neeke&quot;
  [3]=&gt;
  string(104) &quot;2018-07-09 12:52:55 | ERROR | 12274 | 5b42ea27db5dc | 1531111975.898 | log message from the other people&quot;
...
}

array(3) {
  [0]=&gt;
  string(93) &quot;2018-07-09 12:52:53 | ERROR | 12247 | 5b42ea2580e51 | 1531111973.528 | log message from neeke&quot;
  [1]=&gt;
  string(93) &quot;2018-07-09 12:52:54 | ERROR | 12256 | 5b42ea26d6657 | 1531111974.878 | log message from neeke&quot;
  [2]=&gt;
  string(93) &quot;2018-07-09 12:52:55 | ERROR | 12265 | 5b42ea277b8d4 | 1531111975.506 | log message from neeke&quot;
}

array(2) {
  [0]=&gt;
  string(93) &quot;2018-07-09 12:52:53 | ERROR | 12247 | 5b42ea2580e51 | 1531111973.528 | log message from neeke&quot;
  [1]=&gt;
  string(93) &quot;2018-07-09 12:52:54 | ERROR | 12256 | 5b42ea26d6657 | 1531111974.878 | log message from neeke&quot;
}
</pre></div>
   </div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-seaslog.analyzerdetail-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li class="member"><span class="methodname"><a href="seaslog.analyzercount.html" class="methodname" rel="rdfs-seeAlso">SeasLog::analyzerCount()</a> - Get log count by level, log_path and key_word</span></li>
  </ul>
 </div>



</div></div></div></body></html>